Insert-only databases are databases in which updates are implemented as inserts of updated records each with a newer timestamp (as opposed to overwriting older records). When such databases are queried, the original (i.e., obsolete) records which remain in the database need to be removed from corresponding sets of results. If the query was by primary key, then all potential records are identified and can be sorted by their timestamps; the record with the most recent timestamp is valid, while all other records are invalid. But if the query was by a non-key field, not all records per primary key may be identified and an incomplete sort may therefore deliver an incorrect result.
As an example, reference is made to Table 1 below.
TABLE 1RecordNameCityTimestamp1SchmidtMünchen422MuellerBerlin443MuellerMünchen474MuellerDresden48At time 47, the entry “Name”=“Mueller” is updated that the field “City” contains the value “München”, at time 48, the entry is updated again and the field “City” does now contain the value “Dresden”.
If the select in the query is by “City=München”, not by the primary key “Name=Mueller”, then records 1 and 3 are returned. But while record 1 is still valid, record 3 was in the interim invalidated by record 4. However, this situation remains undetected because record 4 is not within the selection criteria of “City=München”.
Similar problems exist for WORM memory (write once read many) like for example CD-Rs/DVD-Rs. With such arrangements, an insert only approach can only be applied because the underlying technology does not allow updates to invalidate overwritten data.